<?php

namespace English\VocabularyBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

use \English\VocabularyBundle\Entity\Vocabulary;


class DefaultController extends Controller
{
    
    public function indexAction()
    {
        $vocabulary =  new Vocabulary;
        $vocabulary->setEnglish('Apple');
        $vocabulary->setFrench('Pomme');
        
        $this->getEm()->persist($vocabulary);
        $this->getEm()->flush();
        
        return $this->render('EnglishVocabularyBundle:Default:index.html.twig', array('vocabulary' => $vocabulary));
    }
    
    public function getEm() {
        return $this->getDoctrine()->getEntityManager();
    }
}
